package com.huika.renrench.control.my.bank.adapter;

import android.content.Context;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.huika.renrench.R;
import com.huika.renrench.control.common.base.BaseAda;
import com.huika.renrench.support.bean.BankCardBean;

public class BankCardAdapter extends BaseAda<BankCardBean> {

	SparseArray<View> map = new SparseArray<View>();
	
	public BankCardAdapter(Context context) {
		super(context);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		if(map.get(position) == null) {
			holder = new ViewHolder();
			convertView = mInflater.inflate(R.layout.item_choose_bindbank, null);
			holder.withdraw_bank_name = (TextView) convertView.findViewById(R.id.withdraw_bank_name);
			convertView.setTag(holder);
			final int p = position;
			map.put(p, convertView);
		} else {
			convertView = map.get(position);
			holder = (ViewHolder) convertView.getTag();
		}
		holder.withdraw_bank_name.setText(group.get(position).getBankName());
		return convertView;
	}
	
	private static class ViewHolder {
		TextView withdraw_bank_name;
	}

}
